package org.interactive.spring.intro.entities;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;

/**
 * The Company entity
 *
 * @author bogdan.solga
 */
@Entity
@Table(name = "COMPANY")
public class Company implements Serializable {

    @Id
    @Column(name = "COMPANY_ID")
    private Integer companyId;

    @Column(name = "COMPANY_NAME")
    private String companyName;

    @Column
    private String profile;

    @OneToMany(targetEntity = User.class, mappedBy = "company", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    private Set<User> users;

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public String getCompanyName() {
        return companyName;
    }

    public void setCompanyName(String companyName) {
        this.companyName = companyName;
    }

    public String getProfile() {
        return profile;
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public Set<User> getUsers() {
        return users;
    }

    public void setUsers(Set<User> users) {
        this.users = users;
    }
}
